<template>
	<view class="wanl-article">
		<view class="edgeInsetTop"></view>
		<!-- 进度条 -->
		<view class="load-progress" :class="loadProgress!=0?'show':'hide'">
			<view class="load-progress-bar bg-orange"
				:style="[{transform: 'translate3d(-' + (100-loadProgress) + '%, 0px, 0px)'}]"></view>
		</view>
		<!-- <view class="article-meta">
			<text class="article-author">sdfsdfsdf</text>
			<text class="article-text">发表于</text>
			<text class="article-time">sdfsd</text>
		</view> -->
		<view class="margin-lr-bj margin-bottom bg-white radius">
			<!-- 					<image :src="$wanlshop.oss(item.image, 388, 218)" mode="widthFix"></image> -->
			<view class="" style="display: flex; align-items: center;padding: 32rpx;position: relative;">
				<image src="/static/images/default/notice.png" mode="widthFix" style="width: 80rpx;"></image>
				<view style="margin-left: 20rpx;display: flex;flex-direction: column;">
					<text style="font-size: 32rpx;font-weight: bold;color: #333;">{{detailsData.user.nickname}}</text>
					<text style="font-size: 24rpx;color: #999">{{detailsData.user.logintime_text}}</text>
				</view>
				<view style="color: #EF430F;font-size: 28rpx;position: absolute;top: 32rpx;right: 32rpx;">
					{{detailsData.category.name}}
				</view>
			</view>
			<view class="padding-bj">
				<view class="text-lg text-cut-2" style="font-size: 32rpx;color: #333;font-weight: bold;">
					{{detailsData.name}}
				</view>
				<image :src="item" v-for="(item,index) in detailsData.images_text" style="width: 160rpx;height: 160rpx;"
					:key="index" mode=""></image>
			</view>

		</view>
	</view>
</template>

<script>
	import htmlParser from '@/common/html-parser';
	export default {
		data() {
			return {
				loadProgress: 0, //进度条
				detailsData: {
					user: {},
					category: {}
				}
			}
		},
		onLoad(option) {
			// 进度条
			this.LoadProgress();
			this.loadData({ product_id: option.id });
			this.$wanlshop.title(option.title);
		},
		methods: {
			// 异步加载
			async loadData(data) {
				await uni.request({
					url: '/xilumarket.product/detail',
					data: data,
					success: ({ res }) => {
						console.log(res)
						this.detailsData = res.data;
						this.loadProgress = 90;
					}
				});
			},
			// 进度条
			LoadProgress() {
				this.loadProgress = this.loadProgress + 2;
				if (this.loadProgress < 100) {
					setTimeout(() => {
						this.LoadProgress();
					}, 100)
				} else {
					this.loadProgress = 0;
				}
			}
		}
	}
</script>

<style>
	.wanl-article .content {}
</style>